package com.yc.love1.controller;

import com.yc.love1.entity.user;
import com.yc.love1.mapper.userMapper;
import com.yc.love1.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("user")
public class userController {

    @Autowired
    userMapper userMapper;

    @RequestMapping("aaaa")
    Result userdata(){

        List<user> getusers = userMapper.getusers();
        return new Result(1, "", getusers);

//        List<user> suser = userMapper.suser();

//        if(suser.size() > 0){
//            return new Result(1, "成功", suser);
//        }else{
//            return new Result(0, "失败", null);
//        }
    }

//    @RequestMapping("one")
//    Result userdataone(int page, int size){
//        Page<user> page1 = new Page<>(page, size);
//        LambdaQueryWrapper<user> lqw = new LambdaQueryWrapper<>();
//        lqw.eq(user::getId, 1);
//        Page<user> userPage = userMapper.selectPage(page1, lqw);
//        return new Result(1, "", userPage);
//    }
}
